import type { PostPatientConsultOrderParams } from '@/types/consult'
import { defineStore } from 'pinia'
import { ref } from 'vue'

// 问诊信息
export const useConsultStore = defineStore(
  'consult',
  () => {
    // 病情描述
    const illnessInfo = ref<
      Pick<
        PostPatientConsultOrderParams,
        'illnessDesc' | 'illnessTime' | 'consultFlag' | 'pictures'
      >
    >({
      illnessDesc: '',
      illnessTime: 2,
      consultFlag: 1,
      pictures: [],
    })

    //问诊类型，医院类型，科室ID
    const type = ref('')
    const illnessType = ref('')
    const depId = ref('')

    // 患者id
    const patientId = ref('')

    return { illnessInfo, type, illnessType, depId, patientId }
  },
  {
    // 持久化
    persist: true,
  }
)